import { Record } from 'immutable';
const DEFAULTS = {
  x: 0,
  y: 0
};

export default class Position extends Record(DEFAULTS) {
  static create(attr = {}) {
    return Position.createFromJSON(attr);
  }

  static createFromJSON(attr = {}) {
    const { x, y } = attr;
    return new Position({
      x,
      y
    });
  }
}
